package com.jmpt.fangbohui.adapter;

import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.jmpt.fangbohui.R;
import com.jmpt.fangbohui.bean.NewHouseOrderBean;
import com.jmpt.fangbohui.bean.HouseRegionBean;

public class NewHouseSelectOrderAdapter extends BaseAdapter {

	public List<NewHouseOrderBean> data = new ArrayList<NewHouseOrderBean>();

	private Context mContext;
	
	public NewHouseSelectOrderAdapter(Context context) {
        mContext = context;
    }

    @Override
    public int getCount() {
        return data.size();
    }

    @Override
    public Object getItem(int position) {
        return null;
    }

    @Override
    public long getItemId(int position) {
        return 0;
    }

    @Override
    public View getView(int position, View view, ViewGroup parent) {
    	if (view == null) {
            view = View.inflate(mContext, R.layout.item_list_home_selete_right, null);
        }
        NewHouseOrderBean bean = data.get(position);
        Holder holder = getHolder(view);
        holder.name.setText(bean.name);

        holder.name.setBackgroundResource(R.drawable.common_hover);
        if (bean.isSelete) {
             holder.name.setTextColor(mContext.getResources().getColor(R.color.main_tab_font_selete));
        } else {
             holder.name.setTextColor(mContext.getResources().getColor(R.color.font_black));
        }
        return view;
    }

    private Holder getHolder(final View view) {
        Holder holder = (Holder) view.getTag();
        if (holder == null) {
            holder = new Holder(view);
            view.setTag(holder);
        }
        return holder;
    }

    class Holder {
        private TextView name;


        public Holder(View view) {
            name = (TextView) view.findViewById(R.id.name);


        }
    }
}
